﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SourceControlEssentials
{
    class Onufreiv : IStudent
    {
        public override int GetHashCode()
        {
            return 14;
        }

        public int Id()
        {
            return this.GetHashCode();
        }

        public string GetLastName()
        {
            return "Onufreiv";
        }

        public string GetFirstName()
        {
            return "Yurii";
        }

        public int GetGroup()
        {
            throw new NotImplementedException();
        }

        public string MethodName()
        {
            return "Reverse casing";
        }

        public string ExecuteStrategy(string value)
        {
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < value.Length; i++)
            {
                if (char.IsUpper(value[i]))
                    sb.Append(value[i].ToString().ToLower());
                else
                    sb.Append(value[i].ToString().ToUpper());
            }
            return sb.ToString();
        }
    }
}
